/*
 * MaTest.cpp
 *
 *  Created on: 2011-7-31
 *      Author: Administrator
 */


#include "gtest/gtest.h"
#include "../src/Situation.h"
#include "../src/RedBing.h"
#include "../src/BlackBing.h"
#include "../src/RedMa.h"

TEST(MaTest,NoChessInWayActions){
	RedMa ma;
	std::vector<Action> actions;
	Position pos(1,2);
	Situation situation;
	situation.AddChess(&ma,pos);
	SituationProjection projection;
	situation.GetProjection(projection);
	ma.GenActions(actions,pos,projection);
    EXPECT_EQ(6,actions.size());
    EXPECT_EQ(Action(Position(1,2),Position(2,4)),actions[0]);
}

TEST(MaTest,PieJiaoMaActions){
	RedMa ma;
	std::vector<Action> actions;
	Position pos(1,2);
	Situation situation;
	situation.AddChess(&ma,pos);

	RedBing bing;
	Position posBing(1,3);
	situation.AddChess(&bing,posBing);

	SituationProjection projection;
	situation.GetProjection(projection);
	ma.GenActions(actions,pos,projection);
    EXPECT_EQ(4,actions.size());
    //EXPECT_EQ(Action(Position(1,2),Position(2,4)),actions[0]);
}



